<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="../static/css/index_admin.css">
  <script src="../static/script/jquery-3.7.1.js"></script>
  <script src="../static/script/index_admin.js"></script>
  <title>管理员页面</title>
</head>
<body>
<div class="container">
  <div class="sidebar">
    <h1>图书信息</h1>
    <div class="user-info">
      <img src="../static/img/souji.png" alt="User Avatar">
      <span class="username" id="{{.User.ID}}">{{.User.Username}}</span>
      <button class="logout-btn">退出</button>
    </div>
    <ul>
      <li><a href="/getAdminBook" id="getAdminBook">图书管理</a></li>
      <li><a href="/getAdminUser" id="getAdminUser">用户管理</a></li>
      <li><a href="/getAllBorrowInfo" id="getAllBorrowInfo">借阅管理</a></li>
    </ul>
  </div>
  <div class="content">
    <h2>筛选条件</h2>
    <form class="filter-form">
      <div>
        <input type="text" placeholder="书名" id="filter-title">
        <input type="text" placeholder="作者" id="filter-author">
      </div>
      <div>
        <input type="number" placeholder="最低价格" id="filter-minPrice">
        <input type="number" placeholder="最高价格" id="filter-maxPrice">
      </div>
      <input type="button" value="筛选" id="checkBookButton">
    </form>

    <div id="overlay"></div>
    <div class="model">
      <h2>添加图书</h2>
      <form id="bookForm" action="/" method="post">
        <div class="form-group">
          <label for="book-title">标题</label>
          <input type="text" id="book-title" name="title" required>
        </div>
        <div class="form-group">
          <label for="book-author">作者</label>
          <input type="text" id="book-author" name="author" required>
        </div>
        <div class="form-group">
          <label for="book-price">价格</label>
          <input type="text" id="book-price" name="price" required>
        </div>
        <div class="form-group">
          <label for="book-quantity">总数量</label>
          <input type="text" id="book-quantity" name="quantity" required>
        </div>
        <div class="form-group">
          <input type="submit" value="确定">
          <input type="button" value="取消">
        </div>
      </form>
    </div>

    <input type="button" value="增加图书" id="addBookButton">
    <ul class="book-list">
      <li class="book-item">图书名</li>
      <li class="book-item">作者</li>
      <li class="book-item">价格</li>
      <li class="book-item">总数量</li>
      <li class="book-item">借出数量</li>
      <li class="book-item">删除图书</li>
      <li class="book-item">修改图书</li>
      {{range .Books}}
      <li class="book-item">{{.Title}}</li>
      <li class="book-item">{{.Author}}</li>
      <li class="book-item">{{.Price}}</li>
      <li class="book-item">{{.TotalQuantity}}</li>
      <li class="book-item">{{.RemainingQuantity}}</li>
      <li class="book-item"><input type="button" value="删除图书" class="bookDeleteBtn"></li>
      <li class="book-item"><input type="button" value="修改图书" class="bookModifyBtn" id="{{.ID}}"></li>
      {{end}}
    </ul>
  </div>
</div>
</body>
</html>
